import { http } from '@/utils/http'
// 接口类型
import type { BannerData, GuessLikeItem, HotItem, MutliItem } from '@/types/home'
import type { PageResult, ParmasData } from '@/types/global'
// 轮播图接口
export const getHomeBannerAPI = (distributionSite = 1) => {
  return http<BannerData[]>({
    method: 'GET',
    url: '/home/banner',
    data: {
      distributionSite, //活动 banner 位置，1 代表首页，2 代表商品分类页，默认为 1
    },
  })
}

// 首页前台分类宫格图接口
export const getHomeMutliAPI = () => {
  return http<MutliItem[]>({
    method: 'GET',
    url: '/home/category/mutli',
  })
}

// 首页热门
export const getHomeHotAPI = () => {
  return http<HotItem[]>({
    method: 'GET',
    url: '/home/hot/mutli',
  })
}

// 猜你喜欢
export const getHomeGuessLikeAPI = (data?: ParmasData) => {
  return http<PageResult<GuessLikeItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data,
  })
}
